-
Notifications
You must be signed in to change notification settings - Fork 0
Support VIRTIO_RING_F_EVENT_IDX #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: xen-virtio-backend
Are you sure you want to change the base?
Support VIRTIO_RING_F_EVENT_IDX #68
Conversation
Xen API contains hypercall, which allows domains to identify Xen version, that is currently used on the system. It can be used to check if current version is supported by Zephyr or to change behavior of the drivers or services. Signed-off-by: Dmytro Semenets <[email protected]> Signed-off-by: Dmytro Firsov <[email protected]>
This hypercall can be used get some information about physical machine and running guests: - sysctl hypercall "xen_sysctl_getphysinfo" allows read information about physical machine: number CPUs, memory sizes, hardware capabilities, etc. - sysctl hypercall "xen_sysctl_getdomaininfolist" returns array of domain info structures that provide information about particular domain(s). Signed-off-by: Dmytro Semenets <[email protected]> Signed-off-by: Mykyta Poturai <[email protected]> Signed-off-by: Dmytro Firsov <[email protected]>
Add the XEN_DOMCTL_getvcpuinfo domain control call to allow Domain-0 to query information about a domain's virtual CPUs. This can be used by management tools and services for gathering statistics and monitoring the current status of vCPUs. Signed-off-by: Dmytro Semenets <[email protected]> Signed-off-by: Dmytro Firsov <[email protected]>
The size is passed in bytes, not in megabytes. So rename the parameter to avoid confusion. Signed-off-by: Mykyta Poturai <[email protected]> Signed-off-by: Dmytro Firsov <[email protected]>
Document all of the public functions in the domctl API with doxygen Signed-off-by: Mykyta Poturai <[email protected]> Signed-off-by: Dmytro Firsov <[email protected]>
If 0 is passed as domain id to the Xen createdomain hypercall, it will allocate a new domain id and return it via the domctl structure. Allow callers to access this new domain id via a pointer arg. This will allow to create domains without explicitly specifying the domain id for them. Signed-off-by: Mykyta Poturai <[email protected]> Signed-off-by: Dmytro Firsov <[email protected]>
Add a new Kconfig option CONFIG_XEN_DOMCTL_INTERFACE_VERSION that allows to change the version of the Domctl interface used by Zephyr to issue domctl hypercalls. Add compile-time checks to enable or disable certain Domctl operations based on the selected Domctl interface version. For now versions 0x15, 0x16, and 0x17 are supported. Also it required to correctly guard domctl call that were not supported prior to specified version. Signed-off-by: Mykyta Poturai <[email protected]> Signed-off-by: Dmytro Firsov <[email protected]>
Add a new Kconfig option CONFIG_XEN_SYSCTL_INTERFACE_VERSION that allows to change the version of the Sysctl interface used by Zephyr to issue sysctl hypercalls. For now versions 0x15 is supported. Signed-off-by: Mykyta Poturai <[email protected]> Signed-off-by: Dmytro Firsov <[email protected]>
Add wrappers for following XEN_DMOP_* hypercalls.
These enables Xen device model control path:
dm_op provides operations to create/manage the ioreq server
so guest MMIO accesses are trapped and handled by the hypervisor.
These are guarded by CONFIG_XEN_DMOP.
- dmop
- dmop_create_ioreq_server
XEN_DMOP_create_ioreq_server
- dmop_map_io_range_to_ioreq_server
XEN_DMOP_map_io_range_to_ioreq_server
- dmop_set_ioreq_server_state
XEN_DMOP_set_ioreq_server_state
- dmop_nr_vcpus
XEN_DMOP_nr_vcpus
- dmop_set_irq_level:
XEN_DMOP_set_irq_level
Signed-off-by: TOKITA Hiroshi <[email protected]>
Import `zephyr-xenlib` module. That contains xen public headers. Signed-off-by: TOKITA Hiroshi <[email protected]>
This introduces the vhost driver framework, providing standard APIs for VIRTIO backend implementations in Zephyr. Includes vringh utility for host-side VIRTIO ring processing based on Linux kernel implementation. Signed-off-by: TOKITA Hiroshi <[email protected]>
Implements VirtIO backend over Xen MMIO interface Signed-off-by: TOKITA Hiroshi <[email protected]>
Add sample application demonstrating vhost driver usage for VIRTIO backend implementations. Includes basic setup and configuration examples for Xen MMIO VirtIO backend. Signed-off-by: TOKITA Hiroshi <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| vq->last_used_idx++; | ||
|
|
||
| if (cbe.cb) { | ||
| cbe.cb(cbe.opaque, used_len); | ||
| } | ||
| } | ||
| } | ||
| if (vq->event_idx_enabled) { | ||
| *vq->used_event = sys_cpu_to_le16(vq->last_used_idx); | ||
| barrier_dmem_fence_full(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Include barrier header for new fence usage
The new event-idx handling in virtio_isr() writes to used_event and then calls barrier_dmem_fence_full() (lines 62‑64), but drivers/virtio/virtio_common.c still only includes logging, byteorder, and virtio headers (lines 7‑11). None of those headers declare barrier_dmem_fence_full(), so this translation unit now lacks a prototype for that function and fails to compile with implicit declaration of function ‘barrier_dmem_fence_full’ when built with the default C standard. Please add #include <zephyr/sys/barrier.h> to this file’s include list.
Useful? React with 👍 / 👎.
3641e2d to
f83e864
Compare
Summary
Testing
Codex Task